/**
 * 
 */
package com.skyline.common.tag;

import java.io.IOException;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;

/**
 * @author skyline
 *
 */
public class AttentionTag extends TagSupport {

	/**
	 * 
	 */
	private static final long serialVersionUID = 5511898207851381008L;

	
	private Long idolId;
	private String idolNickname;
	private String idolPortrait;
	private String idolType;
	
	public Long getIdolId() {
		return idolId;
	}
	public void setIdolId(Long idolId) {
		this.idolId = idolId;
	}
	public String getIdolNickname() {
		return idolNickname;
	}
	public void setIdolNickname(String idolNickname) {
		this.idolNickname = idolNickname;
	}
	public String getIdolPortrait() {
		return idolPortrait;
	}
	public void setIdolPortrait(String idolPortrait) {
		this.idolPortrait = idolPortrait;
	}
	public String getIdolType() {
		return idolType;
	}
	public void setIdolType(String idolType) {
		this.idolType = idolType;
	}

	@Override
	public int doEndTag() throws JspException {
		try {
			pageContext.getOut().println(getAttentionTag());
		} catch (IOException e) {
			e.printStackTrace();
		}
		return EVAL_BODY_INCLUDE;
	}
	public String getAttentionTag(){
		String tagContent="";
		tagContent+="<div>";
	//	tagContent+="<script type=\"text/javascript\">";
	//	tagContent+="jQuery(\"document\").ready(function(){Attention.ajaxIsAttention(\""+idolId+"\"); alert();});";
	//	tagContent+="<a href='javascript:Attention.payAttention(\""+idolId+"\",\""+idolNickname+"\",\""+idolPortrait+"\",\""+idolType+"\")' ";
	//	tagContent+="'>关注测试 </a>";
	//	tagContent+="</script>";
	//	tagContent+= "< input id='"+"attention"+"' type='"+"button"+"' name='"+"attention"+"' value='"+"取消关注"+"' onclick='"+""+"'>";
		tagContent+="<input id="+idolId+ "_attention type='button'  onclick=''>";
		tagContent+="</div>";
		tagContent+="<script type=\"text/javascript\">";
		tagContent+="jQuery(\"document\").ready(function(){Attention.ajaxIsAttention(\""+idolId+"\",\""+idolNickname+"\",\""+idolPortrait+"\",\""+idolType+"\");});";
		tagContent+="</script>";
		return tagContent;
	}


}
